package com.qf.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
public class R<T> implements Serializable {

    //响应码
    private Integer code = Code.SUCCESS;
    //响应消息
    private String msg;
    //实际的返回数据
    private T data;

    /**
     * 静态接口
     */
    public static interface Code {

        //成功
        Integer SUCCESS = 100;
        //失败
        Integer ERROR = 400;
        //强制登录
        Integer MUST_LOGIN = 500;

    }
}
